import Vue from 'vue'
import Router from 'vue-router'

import './assets/iconfont.css'

Vue.use(Router)

export default new Router({
  base: process.env.BASE_URL,
  routes: [
    {
      path:'/test',
      name:'test',
      component:()=>import('./views/Test.vue')
    },
    {
      path:'/classdetail',
      name:'classdetail',
      component:()=>import('./views/Classdetail.vue'),
    },
    {
      path:'/membercenter',
      name:'membercenter',
      component:()=>import('./views/Membercenter.vue')
    },
    {
      path:'/membergrow',
      name:'membergrow',
      component:()=>import('./views/Membergrow.vue')
    },
    {
      path:'/myinfo',
      name:'myinfo',
      component:()=>import("./views/Myinfo.vue")
    },
    {
      path:'/myprivilege',
      name:'myprivilege',
      component:()=>import("./views/Myprivilege.vue")
    },
    {
      path:'/mygiftcard',
      name:'mygiftcard',
      component:()=>import("./views/Mygiftcard.vue")
    },
    {
      path:'/mymessage',
      name:'mymessage',
      component:()=>import("./views/Mymessage.vue")
    },
    {
      path:'/mycollect',
      name:'mycollect',
      component:()=>import("./views/Mycollect.vue")
    },
    {
      path:'/nomoney',
      name:'nomoney',
      component:()=>import("./views/Nomoney.vue")
    },
    {
      path:'/havemoney',
      name:'havemoney',
      component:()=>import("./views/Havemoney.vue")
    },
    {
      path:'/finish',
      name:'finish',
      component:()=>import("./views/Finish.vue")
    },
    {
      path:'/other',
      name:'other',
      component:()=>import("./views/Other.vue")
    },
    {
      path:'/insertaddress',
      name:'insertaddress',
      component:()=>import("./views/Insertaddress.vue")
    },
    {
      path:'/manageaddress',
      name:'manageaddress',
      component:()=>import("./views/Manageaddress.vue")
    },
    {
      path:'/updateaddress',
      name:'updateaddress',
      component:()=>import("./views/Updateaddress.vue")
    },
    {
      path:'/setting',
      name:'setting',
      component:()=>import("./views/Setting.vue")
    },
    {
      path: '/',
      redirect:"/index",
    },
    {
      path:'/index',
      name:'index',
      meta:{
        title:'首页',
      },
      component:()=>import('./views/Index.vue'),
      children:[
        {
          path:'/index',
          name:'index',
          component:()=>import('./views/IndexContent.vue')
        },
        {
          path:'/cart',
          name:'cart',
          component:()=>import('./views/Cart.vue'),
          children:[
            {
              path:'/guesslike',
              name:'/guesslike',
              component:()=>import('./views/Guesslike'),
            },
            {
              path:'/cartlist',
              name:'/cartlist',
              component:()=>import('./views/Cartlist'),
            }
          ]
        },
        {
          path: '/classify',
          name: 'classify',
          redirect: '/Classcontent',
          component: function(){
            return import('./views/Classify.vue');
          },
          children:[
            {
              path:'/Classcontent',
              name:'Classcontent',
              component:()=>import('./views/Classcontent.vue')
            }
          ]
        },
        {
          path:'/my',
          name:'my',
          component:()=>import("./views/My.vue")
        },
        {
          path:'/discover',
          name:'discover',
          component:()=>
          import('./components/head2.vue')
          
        },
      ]
    },
    {
      path:'/ProdDetail',
      name: 'ProdDetail',
      component:()=>import('./views/ProdDetail.vue')
    },
    {
      path:'/Space',
      name:'Space',
      component:()=>import('./views/Space.vue')
    },
    {
      path:'/searchcontent',
      name:'searchcontent',
      component:()=>import('./views/SearchContent.vue')
    },
    {
      path:'/search',
      name:'search',
      component:()=>import('./views/Search.vue')
    },
    // 首页 
    {
      path:'/login',
      name:'login',
      component:()=>{
        return import('./views/login.vue')
      }
    },
    //发现
    // {
    //   path:'/discover',
    //   name:'discover',
    //   component:()=>{
    //     return import ('./components/head2.vue') 
    //   }
    // },
    //注册
    {
      path:'/register',
      name:'register',
      component:()=>{
        return import ('./views/Register.vue')
      }

    },
    {
      path:'/ceshi',
      name:"ceshi",
      component:()=>{
        return import ('./views/Discover.vue')
      }
    },
    {
      path:'/discover/detail',
      name:'discover_detail',
      component:()=>{
        return import ('./views/Discover_detail.vue')
      }
    },
    {
      path:'/updatename',
      name:'updatename',
      component:()=>{
        return import ('./views/UpdateName.vue')
      }
    },
  ]
})
